<?php

/**
 * supervisorvacio actions.
 *
 * @package    gestdent
 * @subpackage supervisorvacio
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $
 */
class supervisorvacio2Actions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */

  public function executeIndex(sfWebRequest $request)
  {

      //GUARDAR FECHA EN VARIABLE DE SESION
      $this->getUser()->setVarFechaReserva($request->getParameter('AgendaFecha'));

      
      //LISTADO DE HORAS
      $this->gestdent_hora_list = GestdentHoraPeer::doSelect(new Criteria());


      //QUERY PARA LISTADO DE BOX
      $MyCriterioBox = new Criteria();
      $MyCriterioBox->add(GestdentBoxPeer::SUCURSAL,$request->getParameter('AgendaSucursal'));
      $MyCriterioBox->addAscendingOrderByColumn(GestdentBoxPeer::NOMBRE);
      $this->gestdent_box_list = GestdentBoxPeer::doSelect($MyCriterioBox);


      //OBTIENE TODOS LOS HORARIOS VIGENTES   
      //$this->gestdent_horario_list = GestdentHorarioPeer::getHorariosVigentes($midiita,$request->getParameter('AgendaFecha'));
      $this->gestdent_horario_list = GestdentHorarioPeer::getHorariosVigentes($request->getParameter('AgendaSucursal'),$request->getParameter('AgendaFecha'));

      
      //OBTIENE TODAS LAS RESERVAS
      //$this->gestdent_reserva_list = GestdentReservaPeer::getReservas();
      //$this->gestdent_reserva_list = GestdentReservaPeer::getReservasByDoctor($request->getParameter('doctor_id2'));
      //$this->gestdent_reserva_list = GestdentReservaPeer::getReservasByDoctor(2);
      //$this->gestdent_reserva_list = GestdentReservaPeer::getReservasByFecha('2010-09-13');
      $this->gestdent_reserva_list = GestdentReservaPeer::getReservasByFecha($request->getParameter('AgendaFecha'));

  }





}
